/**
 * Created by IntelliJ IDEA.
 * User: Liu Yuhong
 * Date: 12-10-25
 * Time: 下午5:05
 * Subpage tender page functions.
 */
var clickTd = null;
var isBiddingProj = null;
$(function() {
	var strTitle = getLanMsg("0ec22210-000064");
	var strItemName1 = getLanMsg("0ec22210-000065");
	var strItemName2 = getLanMsg("0ec22210-000066");
    var menuGroups = [
        {
            'menuId': "tenderMenu",
            'menuTitle': strTitle,
            'iconImg': null,
            'needShow': bModuleEBP,
            'items': [
                {
                    'itemId': "tenderMenuItem1",
                    'itemUrl': "/ebvp/sourcing/biddingprojlist?menuid=21",
                    'itemName': strItemName1,
                    'needShow': bModuleEBP,
                    'callback': function() { window.location = "/ebvp/sourcing/biddingprojlist?menuid=21"; return false; }
                },
                {
                    'itemId': "tenderMenuItem2",
                    'itemUrl': "/ebvp/sourcing/badeprojlist?menuid=22",
                    'itemName': strItemName2,
                    'needShow': bModuleEBP,
                    'callback': function() { window.location = "/ebvp/sourcing/badeprojlist?menuid=22"; return false; }
                }
            ]
        }
    ];
    
    $( "#columnLeft" ).UIColumnMenu({
        'menuGroups': menuGroups,
        'menuHeight': heigth,
        'singleGroup': true
    });

	if(isBiddingProj != null &&  !isBiddingProj){
		$(function() {
			$( "#tenderMenuItem2" ).parents("ul").find(".current").removeClass("current");
			$( "#tenderMenuItem2" ).addClass("current");
		});
	}

    $( "#tenderListTable tr" ).not(".inner_flow").bind('click', function() {
        var hiddenTd = $( this ).next(".inner_flow");
        if(clickTd != null){
        	clickTd.hide();
        }
        if(hiddenTd.is(":hidden")) {
            hiddenTd.show();
//            hiddenTd.find("td").find("div").slideDown();
        } else {
//            hiddenTd.find("td").find("div").slideUp(function() {
//            });
            hiddenTd.hide();
        }
        clickTd = hiddenTd;
    });
});
